package JavaSE.CODE.javase;

public class MyExceptionTest{
    public static void main(String[] args) {
        int a = 11;
        try {
            test(a);
        } catch (Exception e) {
            a=a%10;
            //System.out.println(e.toString());
            System.out.println("ok, a has been done! a is " + a +" now");
        }finally {
            System.out.println("finally is here");
        }

        System.out.println("除了finally我也可以被执行");
    }

    public static void test(int a) throws Exception{
        if(a>10) {
            throw new MyException(a);
        }
        System.out.println("ok");
    }
}
